<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('文章统计')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                文章ID：
                                <input type="number" name="articleId"/>
                            </li>
                            <li>
                                用户ID：
                                <input type="number" name="userId"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var removeFlag = [[${@permission.hasPermi('cms:articleCount:remove')}]];
        var prefix = ctx + "cms/articleCount";
        $(function() {
            var options = {
                url: prefix + "/articleCount",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "文章统计",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'articleId', 
                    title : '文章Id'
                },
                    {
                        field: 'articleTitle',
                        title: '文章标题',
                        formatter:function(value, row, index) {
                            if(value.length>12){
                                return '<a href="#" title="'+value+'">'+value.substring(0,12)+'..</a>';
                            }
                            else
                            {
                                return '<a href="#" title="'+value+'">'+value+'</a>';
                            }
                        }
                    },
                {
                    field : 'articleLook', 
                    title : '浏览数'
                },
                {
                    field : 'articleLike', 
                    title : '喜欢数'
                },
                {
                    field : 'articleNasty', 
                    title : '不喜欢数'
                },
                {
                    field : 'articleDiscuss', 
                    title : '讨论数'
                },
                {
                    field : 'articleScore', 
                    title : '评分'
                },
                {
                    field : 'articleShare', 
                    title : '分享数'
                },
                {
                    field : 'articleCollect', 
                    title : '收藏数'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>